package jk.zmn.thread.status;

import sun.util.calendar.BaseCalendar;

import java.sql.Time;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 张梦楠
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2018/5/2615:51
 * @blog www.itzmn.com
 *
 * sleep模拟考试倒计时
 */
public class SleepThreadDemo {

     public static void main(String[] args) throws ParseException {
         SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");

         Date date = new Date();
         long time = date.getTime();
         System.out.println(format.format(new Date(time)));
         long l = time + 60 * 1000 *60*2; //构建两个小时
         Date date1 = new Date(l);
         System.out.println(format.format(date1));

         Date date3 = new Date();

        /* while (true){
             if (l-new Date().getTime()<0){
                 break;
             }else {
                 long l1 = l - new Date().getTime();
                 System.out.println(format.format(new Date(l1)));
             }
         }*/


     }

}
